import React from 'react'

import {useLocation,useHistory} from 'react-router-dom';

import './ArticleDetail.scss'

const ArticleDetail: React.FC = ()=>{
    let location = useLocation();
    let history = useHistory();
        //返回上一页
    function back() {
        history.goBack()
        }
    return (
        <div className="articledetail">
              <div className="heads">
                <span onClick={back}><svg  className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1864" width="20" height="20"><path d="M294.13376 512c0-13.70112 5.23264-27.40224 15.6672-37.84704l328.704-328.69376c20.91008-20.91008 54.80448-20.91008 75.70432 0 20.89984 20.89984 20.89984 54.79424 0 75.70432L423.36256 512l290.83648 290.83648c20.89984 20.89984 20.89984 54.80448 0 75.70432-20.89984 20.91008-54.79424 20.91008-75.70432 0l-328.704-328.69376C299.35616 539.40224 294.13376 525.70112 294.13376 512z" p-id="1865"></path></svg></span>
              </div>
            <h1>{ (location.state as{title:string}).title}</h1>
            <iframe src={(location.state as { url: string }).url} >
            </iframe>
        </div>
    )
};

export default ArticleDetail;